package net.sk.china.city.service.impl;

import java.util.List;
import net.sk.china.city.service.IArAgreementService;
import net.sk.china.city.utils.DateUtils;
import net.sk.china.city.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import net.sk.china.city.mapper.ArAgreementMapper;
import net.sk.china.city.domain.ArAgreement;

/**
 * 协议列表Service业务层处理
 * 
 * @author gxf
 * @date 2024-04-17
 */
@Service
public class ArAgreementServiceImpl implements IArAgreementService
{
    @Autowired
    private ArAgreementMapper arAgreementMapper;

    /**
     * 查询协议列表
     * 
     * @param id 协议列表主键
     * @return 协议列表
     */
    @Override
    public ArAgreement selectArAgreementById(Long id)
    {
        return arAgreementMapper.selectArAgreementById(id);
    }

    /**
     * 查询协议列表列表
     * 
     * @param arAgreement 协议列表
     * @return 协议列表
     */
    @Override
    public List<ArAgreement> selectArAgreementList(ArAgreement arAgreement)
    {
        return arAgreementMapper.selectArAgreementList(arAgreement);
    }

    /**
     * 新增协议列表
     * 
     * @param arAgreement 协议列表
     * @return 结果
     */
    @Override
    public int insertArAgreement(ArAgreement arAgreement)
    {
//        arAgreement.setCreateBy(SecurityUtils.getUsername());
//        arAgreement.setCreateTime(DateUtils.getNowDate());
        return arAgreementMapper.insertArAgreement(arAgreement);
    }

    /**
     * 修改协议列表
     * 
     * @param arAgreement 协议列表
     * @return 结果
     */
    @Override
    public int updateArAgreement(ArAgreement arAgreement)
    {
//        arAgreement.setUpdateBy(SecurityUtils.getUsername());
//        arAgreement.setUpdateTime(DateUtils.getNowDate());
        return arAgreementMapper.updateArAgreement(arAgreement);
    }

    /**
     * 批量删除协议列表
     * 
     * @param ids 需要删除的协议列表主键
     * @return 结果
     */
    @Override
    public int deleteArAgreementByIds(Long[] ids)
    {
        return arAgreementMapper.deleteArAgreementByIds(ids);
    }

    /**
     * 删除协议列表信息
     * 
     * @param id 协议列表主键
     * @return 结果
     */
    @Override
    public int deleteArAgreementById(Long id)
    {
        return arAgreementMapper.deleteArAgreementById(id);
    }
}
